#include "ros/ros.h"
#include "geometry_msgs/Twist.h"

int main(int argc, char** argv) {
    ros::init(argc, argv, "rectanglular");
    ros::NodeHandle nh;
    ros::Publisher pub = nh.advertise<geometry_msgs::Twist>("/turtle1/cmd_vel", 10);
    ros::Rate rate(10);
    geometry_msgs::Twist twist;
    int i = 0;
    while (ros::ok()) {
        twist.linear.x = 7;
        twist.angular.z = 0;
        pub.publish(twist);
        if (++i % 5 == 0) {
            twist.linear.x = 0;
            twist.angular.z = 3.14159265358979323846;
            pub.publish(twist);
            ros::Duration(0.5).sleep();
        }
        rate.sleep();
        ros::spinOnce();
    }
    return 0;
}